//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Base/Engine.Base.h"

#define int8		Engine::UXTypes::int8
#define int16		Engine::UXTypes::int16
#define int32		Engine::UXTypes::int32
#define uint8		Engine::UXTypes::uint8
#define uint16		Engine::UXTypes::uint16
#define uint32		Engine::UXTypes::uint32
#define float32		Engine::UXMath::float32
#define float64		Engine::UXMath::float64

#pragma warning (push)
#pragma warning (disable: 4005)

#include <Box2D/Box2D.h>

#pragma warning (pop)

#undef int8
#undef int16
#undef int32
#undef uint8
#undef uint16
#undef uint32
#undef float32
#undef float64


namespace Engine
{
namespace Physics2D
{

	struct Utils
	{
		static vec2 const &		Vec2 (const b2Vec2 &v)		{ return ReferenceCast< vec2 >( v ); }
		static vec2 &			Vec2 (b2Vec2 &v)			{ return ReferenceCast< vec2 >( v ); }

		static b2Vec2 const &	Vec2 (const vec2 &v)		{ return ReferenceCast< b2Vec2 >( v ); }
		static b2Vec2 &			Vec2 (vec2 &v)				{ return ReferenceCast< b2Vec2 >( v ); }

		static vec2 const *		Vec2Ptr (const b2Vec2 *p)	{ return (vec2 const *) p; }
		static vec2 *			Vec2Ptr (b2Vec2 *p)			{ return (vec2 *) p; }

		static b2Vec2 const *	Vec2Ptr (const vec2 *p)		{ return (b2Vec2 const *) p; }
		static b2Vec2 *			Vec2Ptr (vec2 *p)			{ return (b2Vec2 *) p; }

		static vec2 const &		SinCos (const b2Rot &r)		{ return ReferenceCast< vec2 >( r ); }
		static vec2 &			SinCos (b2Rot &r)			{ return ReferenceCast< vec2 >( r ); }
	};


}	// Physics2D
}	// Engine